import Vue from "vue"
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import API from "@/api"
import ButtonAgain from '@/components/ButtonAgain.vue'
import DrawPieImage from '@/components/DrawPieImage.vue'

Vue.use(ElementUI)
Vue.config.productionTip = false
Vue.prototype.$API = API

/* 全局混入的方法 */
Vue.mixin({
  methods:{
    // 处理头像
    mixinPrefixAdd(url,prefix="https://iot.fastbee.cn/prod-api"){
      let reg = /^http(s)?:\/\//
      return reg.test(url) ? url : prefix+url
    }
  }
})


/* 注册全局组件 */
Vue.component(ButtonAgain.name, ButtonAgain)
Vue.component(DrawPieImage.name, DrawPieImage)
